package com.zjw.zy.coreui.fragment.holder

import android.view.MotionEvent
import android.view.View
import android.widget.ImageView
import android.widget.TextView
import com.zjw.zy.R
import com.zjw.zy.base.GestureRecyclerView
import com.zjw.zy.base.GestureViewHolder
import com.zjw.zy.bean.ToolIcon
import com.zjw.zy.utils.ResourcesUtils

class ToolHolder(itemView: View) : GestureViewHolder<ToolIcon>(itemView) {

    private val mIcon: ImageView by lazy { findViewById(R.id.tools_item_image) }
    private val mName: TextView by lazy { findViewById(R.id.tools_item_name) }

    override fun onBindListener() {

    }

    override fun onBindData(data: ToolIcon?) {
        data?.let {
            mName.text = data.name
            mIcon.setImageDrawable(ResourcesUtils.getDrawable(data.imageRes))
        }
    }

    override fun toString(): String {
        return mName.text.toString()
    }

    override fun onUpSlide(parent: GestureRecyclerView, event: MotionEvent) {
        
    }

    override fun onDownSlide(parent: GestureRecyclerView, event: MotionEvent) {
        
    }

    override fun onLeftSlide(parent: GestureRecyclerView, event: MotionEvent) {
        
    }

    override fun onRightSlide(parent: GestureRecyclerView, event: MotionEvent) {
        
    }

    override fun onClick(parent: GestureRecyclerView, event: MotionEvent) {
        
    }

    override fun onLongPress(parent: GestureRecyclerView, event: MotionEvent) {
        
    }

    override fun onDoubleClick(parent: GestureRecyclerView, event: MotionEvent) {
        
    }

    override fun onDown(parent: GestureRecyclerView, event: MotionEvent) {
        
    }

}